<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="com/jquery.js"></script>
</head>
<body>
    <h2 class="change">Please sign up.</h2>
    <button id="root">Login</button>
<script type="text/javascript">
    $(function () {
        var i = 0;
        $("#root").click(function () {
            if(i == 0){
                $(".change").text("Welcome back!");
                $(this).text("Logout");
                i = 1 ;
            }
            else{
                $(".change").text("Please sign up.");
                $(this).text("Login");
                i = 0;
                console.log(i);
            }
        })
    })
</script>
</body>
</html>